//
//  StatusToolsView.swift
//  个人微博
//
//  Created by guo3920591 on 16/4/21.
//  Copyright © 2016年 guo3920591. All rights reserved.
//

import UIKit

class StatusToolsView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        //设置界面
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    // MARK: - 私有控件
    private let rewteedButton: UIButton = UIButton(gxl_title: " 转发",  titleFont: 12, imgName: "timeline_icon_retweet", backImgName: "timeline_card_middle_background")
    private let commentButton: UIButton = UIButton(gxl_title: " 评论",  titleFont: 12, imgName: "timeline_icon_comment", backImgName: "timeline_card_middle_background")
    private let supportButton: UIButton = UIButton(gxl_title: " 点赞",  titleFont: 12, imgName: "timeline_icon_unlike", backImgName: "timeline_card_middle_background")
    private let setpLine1:UIImageView = UIImageView(imageName: "timeline_card_bottom_line")
    private let setpLine2:UIImageView = UIImageView(imageName: "timeline_card_bottom_line")
    
    private let topImageViewLine:UIImageView = {
        
        let img = UIImageView()
        
         img.backgroundColor = GXLcellColor
        
        return img
    }()
}
// MARK: - 设置界面
extension StatusToolsView{
    
    private func setupUI(){
        
        backgroundColor = UIColor(patternImage: UIImage(named: "timeline_card_bottom_background")!)
        //添加控件
        addSubview(rewteedButton)
        addSubview(commentButton)
        addSubview(supportButton)
        addSubview(setpLine1)
        addSubview(setpLine2)
        addSubview(topImageViewLine)
        //自动布局
        rewteedButton.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(self)
            make.top.equalTo(self)
            make.bottom.equalTo(self)
            make.width.equalTo(commentButton.snp_width)
        
        }
        
        commentButton.snp_makeConstraints { (make) -> Void in
            
            make.top.equalTo(self)
            make.bottom.equalTo(self)
            make.left.equalTo(rewteedButton.snp_right)
            make.width.equalTo(supportButton.snp_width)
            
        }
        
        supportButton.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(commentButton.snp_right)
            make.top.equalTo(self)
            make.bottom.equalTo(self)
            make.right.equalTo(self)
            
        }
        
        setpLine1.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(commentButton)
            
            make.centerY.equalTo(self)
        }
        setpLine2.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(commentButton.snp_right)
            
            make.centerY.equalTo(self)
        }
        
        topImageViewLine.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(self)
            make.right.equalTo(self)
            make.top.equalTo(self)
            make.height.equalTo(1)
            
        }
        
        
    }

}
